<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <title>会议助手</title>
    <link rel="stylesheet" href="../css/mui.min.css">
    <script src="../js/mui.min.js"></script>
    <link rel="stylesheet" href="../css/elementui.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="../css/app.css" />
    <link rel="stylesheet" href="../npl/css/vant.mini.css" />
    <link rel="stylesheet" href="../css/voice.css">
    <script src="../js/vue.js"></script>
    <script src="../js/vconsole.min.js"></script>
    <script src="../js/jweixin-sgccigw-1.0.0.js"></script>
    <script src="../js/jquery-3.6.0.min.js"></script>
    <script src="../js/sm2.js"></script>
    <script src="../js/sm3.js"></script>
    <!-- <script src="../js/feedback.js"></script> -->
    <script src="../js/clipboard.js"></script>
    <script src="../js/flexible.js"></script>
    <script src="../npl/js/vant.mini.js"></script>
    <script src="../js/elementui.js"></script>
    <script src="../common/hyzs/hyzs.js"></script>
    <script src="./text.js" type="text/javascript"></script>

    <style scoped>
        #app {
            background-color: #FFF;
        }

        .program-titles {
            height: 1rem;
            margin: 0.2rem 0.3rem;
            border-bottom: 1px solid #e9e7e7;
        }

        .step-row {
            height: 100%;
            text-align: center;
            display: flex;
            align-items: center;
        }

        .pre-next {
            display: flex;
            padding-right: 0.3rem;
        }

        .pre {
            margin: 0 .2rem;
            width: .7rem;
            height: .5rem;
        }

        .next {
            width: .7rem;
            height: .5rem;
        }

        .step img {
            /* height: 100%;
width: 100%; */
        }

        .program-main .van-divider {
            margin: 10px 0px !important;
        }

        .program-title {
            width: 33%;
            text-align: center;
        }

        .active-title {
            color: #000;
        }

        .inactive-title {
            color: #ccc;
        }

        .main-body {
            height: calc(100% - 2.7rem);
        }

        .program-bottom {
            height: 1rem;
            padding: 0px 5px;
            margin-bottom: 0.2rem;
            display: flex;
        }

        .program-bottom .bottom-left {
            width: 25%;
            margin-left: 8%;
            text-align: center;
        }

        .program-bottom .bottom-right {
            width: 59%;
            height: 0.9rem;
            display: flex;
            margin: 0px 4%;
            text-align: center;
            border-radius: 25px;
            border: solid 1px #4b4bb9;
        }

        .pop_title {
            font-family: PingFang SC;
            font-weight: bold;
            color: #2d343c;
            font-size: 16px;
        }

        .upload_img {
            width: 100%;
            position: relative;
            height: 4.5rem;
            display: flex;
            justify-content: center;
            background: url("../image/bk.png") no-repeat;
            background-size: 100% 99%;
        }

        .form_wrapper {
            display: flex;
            width: 100%;
            height: 78%;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }

        .form_img {
            width: 25%;
            height: 38%;
        }

        .fileImg {
            width: 100%;
            height: 100%;
            flex: 1;
            display: flex;
            overflow: hidden;
            flex-direction: column;
            padding: 14px .3rem 0;
        }

        .header_tit {
            display: flex;
            flex-direction: column;
        }

        .hyzsBox {
            display: flex;
            overflow: scroll;
            position: relative;
            flex: 1;
            /* padding: 0 0 2.5rem */
        }

        .clock_img {
            margin: -0.02rem .1rem 0 0;
            width: .28rem;
            display: inline-block;
            height: .28rem;
        }

        .clock_box {
            display: flex;
            align-items: center;
        }

        .summaryBox {
            width: 100%;
            height: 40px;
            background-color: #8695bd;
            border-radius: 25px;
        }

        .summary {
            color: #fff;
            width: 100%;
            background-color: #8695bd !important;
            border-radius: 25px;
            height: 100%;
        }

        .summBox {
            width: 100%;
            position: fixed;
            bottom: .3rem;
            z-index: 99;
            padding: 0 .3rem;
            left: 0rem;
            display: flex;
            justify-content: center;
        }

        .cleanBtn {
            margin-right: .3rem;
            width: 50px;
            font-size: 13px;
            height: 27px
        }

        .flowPath {
            position: absolute;
            width: 73%;
            left: 16%;
            bottom: 15%;
        }

        .delFile {
            position: absolute;
            right: 5%;
            top: 8%;
        }

        .wrpper {
            /* width: 34px; */
            margin-top: 5px;
            height: 100%;
            display: flex;
            justify-content: space-between;
            position: relative;
            align-items: center;
        }

        .List_img {
            width: 0rem;
            height: .7rem;
            /* position: absolute; */
            /* left: 0;
    top: 6% */
        }

        .List_title1 {
            width: 100%;
            height: .5rem;
            line-height: .5rem;
            position: absolute;
            font-family: PingFang SC;
            font-weight: 500;
            color: #2d343c;
            font-size: 13px;
            left: 5%;
            top: -6%
        }

        .List_wrapper1 {
            height: 16px;
            width: 100%;
            line-height: 16px;
            position: absolute;
            left: 5%;
            top: 65%
        }

        .form_wrapper_img1 {
            /* width: 100px;
            height: 1rem; */
        }

        .form_wrapper_loading {
            width: 2.4rem;
            height: 2.4rem;
        }

        .form_wrapper_loading img {
            width: 100%;
            height: 100%;
        }

        .form_wrapper_zt {
            width: 100%;
            bottom: .8rem;
            left: 30%;
            position: absolute;
            display: flex;
        }

        .form_wrapper_zt_img {
            width: 39px;
            height: 44px;
        }

        .form_wrapper_zt_img img {
            width: 100%;
            height: 100%;
        }

        .editBtn {
            width: 70px;
        }

        .zzc {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 8888 !important;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, .7)
        }

        .van-overlay {
            display: none;
            top: 0 !important;

        }

        .van-popup {
            z-index: 99999 !important;
        }
    </style>
</head>

<body class="program-body">
    <div id="app" v-cloak>
        <div class="is-loading">
            <div class="curtain">
                <div class="loadingBgc">
                    <div class="loader"></div>
                </div>
            </div>
        </div>
        <div class="trainTickets program-main" style="height: calc(100% - 1.2rem);">
            <div class="header_tit" style="height: 100%;">

                <van-nav-bar title="会议助手" :border=false left-arrow>
                    <template #left>
                        <div class="back_l" @click="home()">
                            <img src="../image/left.png" alt="" />
                        </div>
                    </template>
                    <template #right>
                        <div v-if="!uploadSeccess" class="cleanYuBox" @click="cleanYu">
                            <van-button type="info" class="cleanBtn" size="small" type="default" round>重传</van-button>
                        </div>
                    </template>
                </van-nav-bar>
                <div class="program-titles">
                    <van-row class="step-row">
                        <van-col class="step" span="6" v-for="(item, index) in stepList" :key="item.id">
                            <img :src="currentStep >= item.step ? item.acIcon : item.disIcon" />
                        </van-col>
                    </van-row>
                </div>
                <!-- <div class="popWrapper"> -->
                <!-- <div class="pop_title" v-text="'文件上传'"> -->
                <!-- </div> -->
                <div class="fileImg" v-if="uploadSeccess" style=" position: relative;">
                    <div class="upload_img">
                        <form class="form-user">
                            <div class="form_wrapper" @click="checkFile" v-if="showImg">
                                <p style="text-align: center;"><img style="width:88%;height: 82%;"
                                        src="../image/upload1.png" alt=""></p>
                                <p style="margin-top:.1rem" class="form_text">点击此处上传录音文件</p>
                            </div>

                            <p v-if="showImg" style="font-size: 11px;" class="form_text">
                                音频格式支持wav，mp3，m4a，amr</p>
                            <p v-if="showImg" style="font-size: 10px;text-align: center;" class="form_text">
                                上传文件大小不超过200MB</p>
                            <div class="form_wrapper" v-else-if="!showImg && progressBar">
                                <p class="form_wrapper_img1"><img src="../image/lu_play.png" alt=""></p>
                            </div>
                            <div class="form_wrapper" v-else>
                                <p class="form_wrapper_loading">
                                    <img src="../image/T29.webp" alt="">
                                </p>
                                <div class="form_wrapper_zt" v-if="translation">
                                    <div class="form_wrapper_zt_img">
                                        <img src="../image/lu_play.png" alt="">
                                    </div>
                                    <div style="margin-left:0.15rem;">
                                        <p style="margin-top:7px" class="form_text" v-text="textTit"></p>
                                        <div style="color: #ee5d5d; font-size: 12px;">
                                            还需等待{{ recordTime | recordTimeText }}
                                        </div>
                                    </div>
                                </div>
                                <div class="form_wrapper_zt" v-else>
                                    <div class="form_wrapper_zt_img">
                                        <img src="../image/lu_play.png" alt="">
                                    </div>
                                    <p style="margin:.4rem 0 0 .15rem" class="form_text" v-text="textTit"></p>
                                </div>

                                <!-- <p style="margin-top:.5rem" class="form_text" v-text="textTit"></p> -->
                                <!-- <p style="margin-top:.5rem" class="form_text" ></p> -->
                            </div>
                            <div class="flowPath" v-if="progressBar">
                                <div class="wrpper">
                                    <div class="List_img"></div>
                                    <div class="List_title1">{{fileName | fileNametext}}</div>
                                    <div class="List_wrapper1">
                                        <el-progress :stroke-width="3" :percentage="progress" color="#13C09B">
                                        </el-progress>
                                    </div>
                                </div>
                            </div>
                            <!-- <div v-if="progressBar" @click="delUplode"> -->
                            <van-icon class="delFile" v-if="!showImg" @click="delUplode" name="cross" />
                            <!-- </div> -->

                        </form>
                    </div>
                </div>
                <div class="fileImg" v-if="!uploadSeccess" style=" position: relative;">
                    <hyzs-page></hyzs-page>

                </div>
            </div>
        </div>
    </div>
    </div>
    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    progressBar: false,
                    progress: 0,
                    textTit: '排队等待...',
                    currentStep: 1,
                    channelId: '',
                    translation: false,
                    uploadSeccess: true,
                    // 设置每个分片的大小（字节）
                    CHUNK_SIZE: 5 * 1024 * 1024 + "", // 1MB
                    // 分片上传成功索引
                    succeed: [],
                    showImg: true,
                    disabledInp: false,
                    fileName: '',
                    myindex: -1,
                    retryNum: 0,
                    timetimer: null,
                    formatList: ['mp3', 'wav', 'amr', 'm4a', "MP3", "WAV", "AMR", "M4A"],
                    //步骤
                    stepList: [{
                            id: '1',
                            acIcon: '../image/step5-ac.png',
                            disIcon: '../image/step5-ac.png',
                            step: 1
                        },
                        {
                            id: '2',
                            acIcon: '../image/step2-ac.png',
                            disIcon: '../image/step2-dis.png',
                            step: 3
                        },
                        {
                            id: '3',
                            acIcon: '../image/step3-ac.png',
                            disIcon: '../image/step3-dis.png',
                            step: 4
                        },
                        {
                            id: '4',
                            acIcon: '../image/step4-ac.png',
                            disIcon: '../image/step4-dis.png',
                            step: 5
                        }
                    ],

                }
            },
            filters: {
                recordTimeText: (value) => {
                    if (!value) return '1分钟';
                    const h = Math.floor(value / 3600)
                    const m = Math.floor(value % 3600 / 60)
                    const s = Math.floor(value % 60)
                    if (h) {
                        return `${h}小时${m}分钟`
                    }
                    if (m) {
                        return `${m}分钟`
                    }
                    return `1分钟`
                },
                fileNametext: (value) => {
                    if (!value) return "";
                    let data = value.split("");
                    if (data.length < 12) {
                        return value;
                    }
                    return value.slice(0, 12) + "...";
                },
            },
            created() {
                const _this = this
                let jsApiList = []
                $.getScript("../js/jweixin-sgccigw-1.0.0.js" /*"js/jweixin-1.0.0.js"*/ , function () {
                    'use strict';
                    wx.ready(function () {
                        wx.onHistoryBack(() => {
                            _this.home()
                            return false
                        })
                    });
                    jsApiList = [
                        'startRecordVoiceBuffer',
                        'ext_AudioRecorder_Start',
                        'ext_AudioRecorder_Stop',
                        'onRecordBufferReceived',
                        'multiWindows_subscribe',
                        'stopRecord',
                        'onHistoryBack',
                    ];
                    wx.config({
                        beta: true,
                        debug: false, 
                        appId: corpid,
                        timestamp: '1626832073',
                        nonceStr: nonceStr,
                        signature: signature,
                        jsApiList: jsApiList
                    });
                });
            },
            mounted() {
                if (sessionStorage.getItem("voiceId")) {
                    this.disabledInp = true
                    this.subStance(sessionStorage.getItem("voiceId"))
                    this.timetimer = setInterval(() => {
                        this.subStance(sessionStorage.getItem("voiceId"))
                    }, 5000)
                }
            },
            methods: {
                createNonceStr(len) {
                    var e = len ? len : 16;
                    var t =
                        "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
                        a = t.length,
                        n = "";
                    for (i = 0; i < e; i++)
                        n += t.charAt(Math.floor(Math.random() * a));
                    return n;
                },
                checkFile() {
                    let _that = this
                    if (_that.disabledInp) {
                        mui.toast('正在处理，请稍后', {
                            duration: 'long',
                            type: 'div'
                        })
                        return
                    }
                    wx.invoke("ext_FileBrowser_StartPreView", {}, function (res) {
                        _that.channelId = "net_upload_" + _that.createNonceStr(16) + new Date()
                            .getTime() + "";
                        _that.progress = 0
                        wx.invoke("multiWindows_subscribe", {
                            channelId: _that.channelId
                        }, function (res) {
                            if (res.err_msg == "multiWindows_subscribe:ok") {
                                var progress = Number(res.data.progress) >= 100 ? 99 : Number(
                                    res.data.progress)
                                _that.progress = progress > _that.progress ? progress : _that
                                    .progress
                            }
                        })
                        if (isflageIOX) {
                            console.log(res, "iosres")
                            const suffix = res.name.split('.').reverse()[0]
                            sessionStorage.setItem("fileName", res.name)
                            sessionStorage.setItem("fileSize", res.size)
                            if (!_that.formatList.includes(suffix)) {
                                mui.toast('选择的文件格式不支持', {
                                    duration: 'long',
                                    type: 'div'
                                })
                                return
                            }
                            if (checkFileNameForSensitiveWords(res.name)) {
                                mui.toast('检测到敏感内容，请确认后再试。', {
                                    duration: 'long',
                                    type: 'div'
                                })
                                return false
                            }
                            if (Number(res.size) / 100000000 > 1) {
                                _that.CHUNK_SIZE = 10 * 1024 * 1024 + ""
                            }
                            if (Number(res.size) / 200000000 > 1) {
                                mui.toast('上传文件大小不能大于200MB', {
                                    duration: 'long',
                                    type: 'div'
                                })
                                return
                            }
                            _that.checkList(res.filePath, res.name, _that.channelId)
                        } else {
                            let recordArr = JSON.parse(res.result)
                            sessionStorage.setItem("fileName", recordArr[0].name)
                            sessionStorage.setItem("fileSize", recordArr[0].fileSize)
                            const suffix = recordArr[0].name.split('.').reverse()[0]
                            if (!_that.formatList.includes(suffix)) {
                                mui.toast('选择的文件格式不支持', {
                                    duration: 'long',
                                    type: 'div'
                                })
                                return
                            }
                            if (checkFileNameForSensitiveWords(recordArr[0].name)) {
                                mui.toast('检测到敏感内容，请确认后再试。', {
                                    duration: 'long',
                                    type: 'div'
                                })
                                return false
                            }
                            if (Number(recordArr[0].fileSize) / 100000000 > 1) {
                                _that.CHUNK_SIZE = 10 * 1024 * 1024 + ""
                            }
                            if (Number(recordArr[0].fileSize) / 200000000 > 1) {
                                mui.toast('上传文件大小不能大于200MB', {
                                    duration: 'long',
                                    type: 'div'
                                })
                                return
                            }
                            _that.checkList(recordArr[0].path, recordArr[0].name, _that.channelId)
                        }
                    })
                },
                delUplode() {
                    let _that_ = this
                    var btnArray = ["取消", "确定"];
                    var i = 0
                    if (_that_.progressBar) {
                        mui.confirm(
                            "是否终止上传？",
                            "消息提醒",
                            btnArray,
                            (e) => {
                                if (i > 0) return
                                i++
                                if (e.index == 1) {
                                    console.log(_that_.channelId, "_that_.channelId")
                                    wx.invoke("ext_Net_FragmentUploadCancel", {
                                        data: {
                                            requestTag: _that_.channelId
                                        }
                                    }, function (response) {
                                        console.log("ext_Net_FragmentUploadCancel end", response);
                                    })
                                    _that_.cleanData();
                                } else {}
                            }
                        );
                    } else {
                        mui.confirm(
                            "是否终止转写？",
                            "消息提醒",
                            btnArray,
                            (e) => {
                                if (i > 0) return
                                i++
                                if (e.index == 1) {
                                    _that_.details()
                                    _that_.cleanYu()
                                }
                            }
                        );
                    }
                },
                cleanData() {
                    this.disabledInp = false
                    this.progressBar = false
                    this.showImg = true
                },
                checkList(path, name, id, hash, index) {
                    let that = this
                    that.showImg = false
                    that.disabledInp = true
                    that.progressBar = true
                    let iscp_port
                    iscp_port = sessionStorage.getItem("iscp_port") || "";
                    let Authentication = sessionStorage.getItem("Authentication");
                    const timestamp = new Date().getTime() + ""
                    let userId = sessionStorage.getItem("userId");
                    let sign = sm3(timestamp + "&" + userId)
                    that.fileName = name
                    let data = {
                        serverAddress: localUrlLink + iscp_port +
                            `/tjAiAssistant/storage/splitUpload2?channelId=${id}`,
                        filePath: path,
                        fragmentSize: that.CHUNK_SIZE,
                        fileName: name,
                        fileHash: hash ? hash : '',
                        upLoadFragmentIndex: index ? index : '',
                        channelId: id,
                        headerData: {
                            sign: sign,
                            userId: userId,
                            type: '0',
                            timestamp: timestamp,
                            Authentication: Authentication,
                        }
                    }
                    wx.invoke("ext_Net_FragmentUpload", {
                        data: data,
                    }, function (res) {
                        if (res.err_msg.endsWith(":ok")) { //成功结果
                            that.recording(id)
                        } else if (res.err_msg.endsWith(":cancel")) {
                            that.cleanData();
                            return
                        } else {
                            console.log(res.fileHash, "失败后的fileHash")
                            console.log(res.upLoadFragmentIndex, "失败后的分片下标")
                            //上传失败
                            if (that.myindex != Number(res.upLoadFragmentIndex)) {
                                that.myindex = Number(res.upLoadFragmentIndex);
                                that.retryNum = 0;
                            }
                            setTimeout(() => {
                                if (that.retryNum > 4) {
                                    var btnArray = ["取消", "确定"];
                                    var i = 0
                                    mui.confirm(
                                        "是否进行重试？",
                                        "上传失败",
                                        btnArray,
                                        (e) => {
                                            if (i > 0) return
                                            i++
                                            if (e.index == 1) {
                                                that.checkList(path, name, id, res.fileHash,
                                                    res.upLoadFragmentIndex)
                                            } else {
                                                that.cleanData()
                                            }
                                        }
                                    );
                                } else {
                                    that.retryNum++
                                    that.checkList(path, name, id, res.fileHash, res
                                        .upLoadFragmentIndex)
                                }

                            }, (that.retryNum + 1) * 1000)
                        }
                    })
                },
                recording(id) {
                    userId = sessionStorage.getItem("userId");
                    unitId = sessionStorage.getItem("unitId");
                    iscp_port = sessionStorage.getItem("iscp_port") || "";
                    let data = {
                        "id": id,
                        "userId": userId,
                        "service": localStorage.getItem("largeModel") ? localStorage.getItem("largeModel") :
                            "BAIDU",
                        "unitId": unitId,
                        "timestamp": new Date().getTime() + ""
                    };

                    data = JSON.stringify(data)
                    let sign = sm3(data);
                    console.log(sign, 789)
                    let AuthenticationSession = sessionStorage.getItem("Authentication");
                    $.ajax({
                        url: localUrlLink + iscp_port + "/tjAiAssistant/voice/addTranscribing",
                        type: "post",
                        async: false,
                        dataType: "json",
                        data: data,
                        headers: {
                            "Content-Type": "application/json;charset=UTF-8",
                            Authentication: AuthenticationSession,
                            sign: sign
                        },
                        success: (res, txt, xhr) => {
                            if (sm3(res.resultValueStr) == xhr.getResponseHeader("sign")) {
                                let Authentication = xhr.getResponseHeader("Authentication")
                                if (res.code == 200) {
                                    if (Authentication) {
                                        this.progress = 100
                                        sessionStorage.setItem("Authentication", Authentication);
                                        mui.toast('上传成功', {
                                            duration: 1000,
                                            type: 'div'
                                        })
                                        sessionStorage.setItem("voiceId", res.resultValue);
                                        this.subStance(res.resultValue)
                                        this.progressBar = false
                                        this.timetimer = setInterval(() => {
                                            this.subStance(res.resultValue)
                                        }, 5000)
                                    }
                                } else if (res.code == 500) {
                                    this.cleanData()
                                    mui.toast(res.resultValue, {
                                        duration: 'long',
                                        type: 'div'
                                    })
                                } else {
                                    mui.toast('请求异常,请稍后再试', {
                                        duration: 'long',
                                        type: 'div'
                                    })
                                }
                            } else {
                                mui.toast('完整性校验失败', {
                                    duration: 'long',
                                    type: 'div'
                                })
                            }
                        },
                        error: (e) => {
                            // $(".curtainVoice").css("display", "none");
                            mui.toast('请求异常,请稍后再试', {
                                duration: 'long',
                                type: 'div'
                            })
                        },
                    });
                },
                resetState() {
                    this.showImg = false;
                    this.titleText = '';
                    this.oldTextitle = '';
                },
                subStance(id) {
                    this.resetState();
                    userId = sessionStorage.getItem("userId");
                    iscp_port = sessionStorage.getItem("iscp_port") || "";
                    let data = {
                        "id": id,
                        "section": 1, // 0不分 1 分段
                        "userId": userId,
                        "timestamp": new Date().getTime() + "",
                    };
                    let AuthenticationSession = sessionStorage.getItem("Authentication");
                    data = JSON.stringify(data)
                    let sign = sm3(data);
                    $.ajax({
                        url: localUrlLink + iscp_port + "/tjAiAssistant/voice/selectByIdVoiceNotes",
                        type: "post",
                        async: false, //是否同步，false表示同步请求
                        dataType: "json",
                        data: data,
                        headers: {
                            "Content-Type": "application/json;charset=UTF-8",
                            Authentication: AuthenticationSession,
                            sign: sign
                        },
                        success: (res, txt, xhr) => {
                            if (sm3(res.resultValueStr) == xhr.getResponseHeader("sign")) {
                                let Authentication = xhr.getResponseHeader("Authentication")
                                if (res.code == 200) {
                                    if (Authentication) {
                                        sessionStorage.setItem("Authentication", Authentication);
                                        this.handleTranslationStatus(res.resultValue.translation,
                                            res);
                                    }
                                } else {
                                    mui.toast(res.resultValue, {
                                        duration: 'long',
                                        type: 'div'
                                    })
                                }
                            } else {
                                mui.toast('完整性校验失败', {
                                    duration: 'long',
                                    type: 'div'
                                })
                            }
                        },
                        error: (e) => {
                            mui.toast('请稍后再试', {
                                duration: 1000,
                                type: 'div'
                            })
                        },
                    });
                },
                handleTranslationStatus(translationStatus, res) {
                    switch (Number(translationStatus)) {
                        case 0:
                            this.textTit = "准备转写..."
                            break;
                        case 1:
                            this.textTit = "正在转写..."
                            break;
                        case 2:
                            this.translation = true
                            this.recordTime = res.resultValue.recordTime
                            this.textTit = "正在转写..."
                            break;
                        case 3:
                            this.textTit = "转写失败， 请重新上传"
                            sessionStorage.removeItem('voiceId')
                            this.cleanData()
                            this.details();
                            break;
                        case 5:
                            this.textTit = "排队等待..."
                            break;
                        case 6:
                            sessionStorage.setItem("voiceDuration", res
                                .resultValue.translation)
                            this.details();
                            this.uploadSeccess = false
                            break;
                        case 7:
                            sessionStorage.setItem("voiceDuration", res
                                .resultValue.translation)
                            this.details();
                            this.uploadSeccess = false
                            break;
                    }
                },
                cleanYu() {
                    sessionStorage.removeItem('voiceId')
                    this.showImg = true
                    this.progressBar = false
                    this.progress = 0
                    this.textTit = '排队等待...',
                        this.uploadSeccess = true
                    this.translation = false
                    this.disabledInp = false
                },
                details() {
                    clearInterval(this.timetimer)
                    window.clearInterval($(this).data("interval"));
                },
                home() {
                    $(location).attr("href", "Home.html");
                },
                createSgin(data) {
                    let hashData = sm3(data);
                    let hashData_last = sm3(hashData);
                    hashData_last = hashData_last.substr(0, 5);
                    hashData += hashData_last;
                    let sign = hashData;
                    return sign;
                },
            }
        })
    </script>
</body>

</html>